package com.tubi.Exception;

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class demo1 {
    public static void main(String[] args) throws ParseException{
//        method(); //NullPointerException 空指针异常
        method1();
    }

    private static void method1() throws ParseException {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
        dateFormat.parse("2020年10月19日" );
    }

    //告诉调用者如果调用会出现NullPointerException 异常
    private static void method() throws  NullPointerException{
        int[] arr = null;
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }
}
